package com.xmcc.controller;

import com.xmcc.common.PageCommon;
import com.xmcc.common.ResultJson;
import com.xmcc.dto.SysAclDto;
import com.xmcc.dto.SysUserDto;
import com.xmcc.pojo.SysAcl;
import com.xmcc.service.SysAclService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("sys/acl")
public class SysAclController {
    @Autowired
    private SysAclService sysAclService;

    @RequestMapping("insert.json")
    public @ResponseBody  ResultJson insert(SysAclDto sysAclDto){
        sysAclService.insert(sysAclDto);
        return ResultJson.success("添加成功！");
    }

    @RequestMapping("update.json")
    public @ResponseBody  ResultJson update(SysAclDto sysAclDto){
        sysAclService.update(sysAclDto);
        return ResultJson.success();
    }


    @RequestMapping("page.json")
    public @ResponseBody ResultJson aclList(Integer aclModuleId,Integer pageSize,Integer pageNo){
        PageCommon<SysAcl> sysAclPageCommon = sysAclService.queryByAclModuleId(aclModuleId,pageSize,pageNo);
        return ResultJson.success(sysAclPageCommon);
    }
}
